// 路由表部分
export const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login/index.vue"),
    meta: {
      title: "登录",
      menu_hidden: true,
    },
  },

  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    redirect: "/home",
    meta: {
      title: "",
      menu_hidden: false,
    },
    children: [
      {
        path: "/home",
        component: () => import("@/views/Home/index.vue"),
        meta: {
          title: "首页",
          menu_hidden: false,
        },
      },
    ],
  },
  {
    path: "/screen",
    name: "Screen",
    component: () => import("@/views/Screen/index.vue"),
    meta: {
      title: "数据大屏",
      menu_hidden: false,
    },
  },
  //基于layout结构显示的路由组件
  {
    path: "/authority",
    meta: {
      title: "权限管理",
      menu_hidden: false,
    },
    children: [
      {
        path: "/authority/menu",
        component: () => import("@/views/Authority/Menu/index.vue"),
        meta: {
          title: "菜单管理",
          menu_hidden: false,
        },
      },
      {
        path: "/authority/role",
        component: () => import("@/views/Authority/Role/index.vue"),
        meta: {
          title: "角色管理",
          menu_hidden: false,
        },
      },
      {
        path: "/authority/user",
        component: () => import("@/views/Authority/User/index.vue"),
        meta: {
          title: "用户管理",
          menu_hidden: false,
        },
      },
    ],
  },
  {
    path: "/goods",
    meta: {
      title: "商品管理",
      menu_hidden: false,
    },
    children: [
      {
        path: "/goods/brand",
        component: () => import("@/views/Goods/Brand/index.vue"),
        meta: {
          title: "品牌管理",
          menu_hidden: false,
        },
      },
      {
        path: "/goods/attr",
        component: () => import("@/views/Goods/Attr/index.vue"),
        meta: {
          title: "属性管理",
          menu_hidden: false,
        },
      },
      {
        path: "/goods/spu",
        component: () => import("@/views/Goods/SPU/index.vue"),
        meta: {
          title: "SPU管理",
          menu_hidden: false,
        },
      },
      {
        path: "/goods/sku",
        component: () => import("@/views/Goods/SKU/index.vue"),
        meta: {
          title: "SKU管理",
          menu_hidden: false,
        },
      },
    ],
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/index.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    name: "any",
    redirect: "/404",
    component: () => import("@/views/404/index.vue"),
  },
];
